﻿<UserControl xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"  xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"  x:Class="FXC.SL.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    xmlns:radDock="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Docking"
    xmlns:uc="clr-namespace:FXC.SL.UserControls"
    xmlns:ucWindow="clr-namespace:FXC.SL.UserControls.Window"
    xmlns:telerikNavigation="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Navigation" 
    xmlns:ucChart="clr-namespace:FXC.SL.UserControls.FXCChart"
    xmlns:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit"
    Loaded="UserControl_Loaded" 
    mc:Ignorable="d" d:DesignWidth="640" d:DesignHeight="480">
    <Grid x:Name="LayoutRoot">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
        <telerikNavigation:RadMenu x:Name="radMenu" Grid.Row="0" Style="{StaticResource MainMenu}" ClickToOpen="True">
            <telerikNavigation:RadMenuItem Header="文件" Style="{StaticResource RadMenuItem1}">
                <telerikNavigation:RadMenuItem x:Name="rmiNewProduct" Header="新图表" Style="{StaticResource RadMenuItem2}">
                    <telerikNavigation:RadMenuItem.Icon>
                        <Image Source="Images/Res/window_new.png" Stretch="None" />
                    </telerikNavigation:RadMenuItem.Icon>
                    <!--<telerikNavigation:RadMenuItem Header="EURAUD" Click="rmiNewChart_Click" />
                    <telerikNavigation:RadMenuItem Header="USDCHF" Click="rmiNewChart_Click" />
                    <telerikNavigation:RadMenuItem Header="GBPUSD" Click="rmiNewChart_Click"/>
                    <telerikNavigation:RadMenuItem Header="USDJPY" Click="rmiNewChart_Click"/>-->
                </telerikNavigation:RadMenuItem>
                <!--<telerikNavigation:RadMenuItem Header="图表夹" Style="{StaticResource RadMenuItem2}">
                    <telerikNavigation:RadMenuItem Header="下一图表夹" Style="{StaticResource RadMenuItem2}" />
                    <telerikNavigation:RadMenuItem Header="前一图表夹" Style="{StaticResource RadMenuItem2}" />
                </telerikNavigation:RadMenuItem>-->
                <telerikNavigation:RadMenuItem x:Name="rimSaveData" Header="保存数据" Style="{StaticResource RadMenuItem2}" Click="rimSaveData_Click">
                    <telerikNavigation:RadMenuItem.Icon>
                        <Image Source="Images/Res/filesave.png" Stretch="None" />
                    </telerikNavigation:RadMenuItem.Icon>
                </telerikNavigation:RadMenuItem>
                <telerikNavigation:RadMenuItem x:Name="rimSaveImg" Header="保存为图片" Style="{StaticResource RadMenuItem2}" Click="rimSaveImg_Click">
                    <telerikNavigation:RadMenuItem.Icon>
                        <Image Source="Images/Res/filesaveas.png" Stretch="None" />
                    </telerikNavigation:RadMenuItem.Icon>
                </telerikNavigation:RadMenuItem>
                <telerikNavigation:RadMenuItem IsSeparator="True" />
                <telerikNavigation:RadMenuItem x:Name="rmiAddUser" Header="开新模拟帐户" Style="{StaticResource RadMenuItem2}" Click="rmiAddUser_Click">
                    <telerikNavigation:RadMenuItem.Icon>
                        <Image Source="Images/Res/add_user.png" Stretch="None" />
                    </telerikNavigation:RadMenuItem.Icon>
                </telerikNavigation:RadMenuItem>
                <telerikNavigation:RadMenuItem Header="登录" Style="{StaticResource RadMenuItem2}" x:Name="rmiLogin" Click="rmiLogin_Click">
                    <telerikNavigation:RadMenuItem.Icon>
                        <Image Source="Images/Res/agt_login.png" Stretch="None" />
                    </telerikNavigation:RadMenuItem.Icon>
                </telerikNavigation:RadMenuItem>
                <telerikNavigation:RadMenuItem IsSeparator="True" />
                <telerikNavigation:RadMenuItem Header="退出" Style="{StaticResource RadMenuItem2}">
                    <telerikNavigation:RadMenuItem.Icon>
                        <Image Source="Images/Res/exit.png" Stretch="None" />
                    </telerikNavigation:RadMenuItem.Icon>
                </telerikNavigation:RadMenuItem>
            </telerikNavigation:RadMenuItem>

            <telerikNavigation:RadMenuItem Header="显示" Style="{StaticResource RadMenuItem1}">
                <telerikNavigation:RadMenuItem Header="语言" Style="{StaticResource RadMenuItem2}">
                    <telerikNavigation:RadMenuItem Header="中文" Style="{StaticResource RadMenuItem2}" />
                    <telerikNavigation:RadMenuItem Header="English" Style="{StaticResource RadMenuItem2}" />
                </telerikNavigation:RadMenuItem>
                <telerikNavigation:RadMenuItem IsSeparator="True" />
                <telerikNavigation:RadMenuItem Header="工具栏" Style="{StaticResource RadMenuItem2}" >
                    <telerikNavigation:RadMenuItem Header="常用" Style="{StaticResource RadMenuItem2}" IsCheckable="True" IsChecked="True" />
                    <telerikNavigation:RadMenuItem Header="图表" Style="{StaticResource RadMenuItem2}" IsCheckable="True" IsChecked="True" />
                    <telerikNavigation:RadMenuItem Header="划线" Style="{StaticResource RadMenuItem2}" IsCheckable="True" IsChecked="True" />
                    <telerikNavigation:RadMenuItem Header="时段" Style="{StaticResource RadMenuItem2}" IsCheckable="True" IsChecked="True" />
                </telerikNavigation:RadMenuItem>
                <telerikNavigation:RadMenuItem Header="图表工具栏" Style="{StaticResource RadMenuItem2}" IsCheckable="True" IsChecked="True" />
                <telerikNavigation:RadMenuItem IsSeparator="True" />
                <telerikNavigation:RadMenuItem Header="市场报价" Style="{StaticResource RadMenuItem2}"/>
                <telerikNavigation:RadMenuItem Header="导航器" Style="{StaticResource RadMenuItem2}"/>
                <telerikNavigation:RadMenuItem x:Name="rmiDataWindow" Header="数据窗口" Style="{StaticResource RadMenuItem2}" IsCheckable="True" IsChecked="True" Click="rmiDataWindow_Click" />
                <telerikNavigation:RadMenuItem Header="终端" Style="{StaticResource RadMenuItem2}"/>
                <telerikNavigation:RadMenuItem Header="智能交易测试" Style="{StaticResource RadMenuItem2}"/>
                <telerikNavigation:RadMenuItem IsSeparator="True" />
                <telerikNavigation:RadMenuItem x:Name="rmiFullScreen" Header="全屏幕" Style="{StaticResource RadMenuItem2}" Click="rmiFullScreen_Click" />
            </telerikNavigation:RadMenuItem>

            <telerikNavigation:RadMenuItem Header="插入" Style="{StaticResource RadMenuItem1}">
                <telerikNavigation:RadMenuItem Header="技术指标" Style="{StaticResource RadMenuItem2}" IsEnabled="False" />
                <telerikNavigation:RadMenuItem IsSeparator="True" IsEnabled="False" />
                <telerikNavigation:RadMenuItem Header="直线" Style="{StaticResource RadMenuItem2}" IsEnabled="False" />
                <telerikNavigation:RadMenuItem Header="通道" Style="{StaticResource RadMenuItem2}" IsEnabled="False" />
                <telerikNavigation:RadMenuItem Header="江恩" Style="{StaticResource RadMenuItem2}" IsEnabled="False" />
                <telerikNavigation:RadMenuItem Header="菲波纳奇" Style="{StaticResource RadMenuItem2}" IsEnabled="False" />
                <telerikNavigation:RadMenuItem Header="图形" Style="{StaticResource RadMenuItem2}" IsEnabled="False" />
                <telerikNavigation:RadMenuItem Header="箭头" Style="{StaticResource RadMenuItem2}" IsEnabled="False" />
                <telerikNavigation:RadMenuItem IsSeparator="True" IsEnabled="False" />
                <telerikNavigation:RadMenuItem Header="安德鲁差分线" Style="{StaticResource RadMenuItem2}" IsEnabled="False" />
                <telerikNavigation:RadMenuItem Header="循环周期线" Style="{StaticResource RadMenuItem2}" IsEnabled="False" />
                <telerikNavigation:RadMenuItem Header="文字" Style="{StaticResource RadMenuItem2}" IsEnabled="False" />
                <telerikNavigation:RadMenuItem Header="文字标签" Style="{StaticResource RadMenuItem2}" IsEnabled="False" />
            </telerikNavigation:RadMenuItem>

            <telerikNavigation:RadMenuItem Header="图表" Style="{StaticResource RadMenuItem1}">
                <telerikNavigation:RadMenuItem Header="技术指标列表" Style="{StaticResource RadMenuItem2}" />
                <telerikNavigation:RadMenuItem Header="对象" Style="{StaticResource RadMenuItem2}" />
                <telerikNavigation:RadMenuItem IsSeparator="True" />
                <telerikNavigation:RadMenuItem x:Name="rmiChartTypes" Header="图表类型" Style="{StaticResource RadMenuItem2}" SubmenuClosed="rmiChartTypes_SubmenuClosed">
                    <telerikNavigation:RadMenuItem Header="柱状图" x:Name="rmiCandleStick" Style="{StaticResource RadMenuItem2}" IsCheckable="True" IsChecked="True" IsEnabled="False" Click="rmiChartType_Click"/>
                    <telerikNavigation:RadMenuItem Header="阴阳烛" x:Name="rmiStick" Style="{StaticResource RadMenuItem2}" IsCheckable="True" Click="rmiChartType_Click" />
                    <telerikNavigation:RadMenuItem Header="折线图" x:Name="rmiLine" Style="{StaticResource RadMenuItem2}" IsCheckable="True"  Click="rmiChartType_Click" />
                </telerikNavigation:RadMenuItem>
                <telerikNavigation:RadMenuItem IsSeparator="True" />
                <telerikNavigation:RadMenuItem Header="时段" Style="{StaticResource RadMenuItem2}" />
                <telerikNavigation:RadMenuItem Header="模板" Style="{StaticResource RadMenuItem2}" />
                <telerikNavigation:RadMenuItem Header="刷新" Style="{StaticResource RadMenuItem2}" />
                <telerikNavigation:RadMenuItem IsSeparator="True" />
                <telerikNavigation:RadMenuItem Header="网格" Style="{StaticResource RadMenuItem2}" />
                <telerikNavigation:RadMenuItem Header="成交量" x:Name="rmiIsShowVolume" Style="{StaticResource RadMenuItem2}" IsCheckable="True" IsChecked="False" Click="rmiIsShowVolume_Click" />
                <telerikNavigation:RadMenuItem Header="自动滚动" Style="{StaticResource RadMenuItem2}" />
                <telerikNavigation:RadMenuItem Header="图表平移" Style="{StaticResource RadMenuItem2}" />
                <telerikNavigation:RadMenuItem IsSeparator="True" />
                <telerikNavigation:RadMenuItem Header="放大" Style="{StaticResource RadMenuItem2}" />
                <telerikNavigation:RadMenuItem Header="缩小" Style="{StaticResource RadMenuItem2}" />
                <telerikNavigation:RadMenuItem Header="图表步进" Style="{StaticResource RadMenuItem2}" />
                <telerikNavigation:RadMenuItem IsSeparator="True" />
                <telerikNavigation:RadMenuItem Header="属性" Style="{StaticResource RadMenuItem2}" />
            </telerikNavigation:RadMenuItem>
            <telerikNavigation:RadMenuItem Header="工具" Style="{StaticResource RadMenuItem1}">
                <telerikNavigation:RadMenuItem Header="新订单" Style="{StaticResource RadMenuItem2}" />
                <telerikNavigation:RadMenuItem IsSeparator="True" />
                <telerikNavigation:RadMenuItem Header="历史数据中心" Style="{StaticResource RadMenuItem2}" />
                <telerikNavigation:RadMenuItem Header="全局变量" Style="{StaticResource RadMenuItem2}" />
                <telerikNavigation:RadMenuItem IsSeparator="True" />
                <telerikNavigation:RadMenuItem Header="选项" Style="{StaticResource RadMenuItem2}" />
            </telerikNavigation:RadMenuItem>
            <telerikNavigation:RadMenuItem Header="窗口" Style="{StaticResource RadMenuItem1}">
                <telerikNavigation:RadMenuItem x:Name="rmSaveDockingStatus" Header="保存窗口状态" Style="{StaticResource RadMenuItem2}" Click="rmSaveDockingStatus_Click" />
                <telerikNavigation:RadMenuItem x:Name="rmReset" Header="重置浮动窗口" Style="{StaticResource RadMenuItem2}" Click="rmReset_Click" />
            </telerikNavigation:RadMenuItem>
            <telerikNavigation:RadMenuItem Header="帮助" Style="{StaticResource RadMenuItem1}">
                <telerikNavigation:RadMenuItem Header="帮助中心" Style="{StaticResource RadMenuItem2}" />
                <telerikNavigation:RadMenuItem Header="联系方式" Style="{StaticResource RadMenuItem2}" />
                <telerikNavigation:RadMenuItem Header="关于" Style="{StaticResource RadMenuItem2}" />
            </telerikNavigation:RadMenuItem>
        </telerikNavigation:RadMenu>
        <StackPanel Grid.Row="1" Style="{StaticResource ToolBarStackPanel}">
            <telerikNavigation:RadToolBar  x:Name="mainToolBar1">
                <telerik:RadDropDownButton x:Name="rddbNewchart">
                    <telerik:RadDropDownButton.Content>
                        <StackPanel Orientation="Horizontal">
                            <Image Width="16" Height="16" Source="Images/Res/window_new.png" ToolTipService.ToolTip="图表夹" />
                            <TextBlock Text="新图表" Margin="5,0" />
                        </StackPanel>
                    </telerik:RadDropDownButton.Content>
                    <telerik:RadDropDownButton.DropDownContent>
                        <telerikNavigation:RadContextMenu x:Name="rmiNewProduct1">
                            <!--<telerikNavigation:RadMenuItem Header="EURAUD" Click="rmiNewChart_Click" />
                            <telerikNavigation:RadMenuItem Header="USDCHF" Click="rmiNewChart_Click" />
                            <telerikNavigation:RadMenuItem Header="GBPUSD" Click="rmiNewChart_Click"/>
                            <telerikNavigation:RadMenuItem Header="USDJPY" Click="rmiNewChart_Click"/>-->
                        </telerikNavigation:RadContextMenu>
                    </telerik:RadDropDownButton.DropDownContent>
                </telerik:RadDropDownButton>
                <Button Tag="图表夹" Click="btnM1_Click">
                    <Image Width="16" Height="16" Source="Images/Res/favorites.png" ToolTipService.ToolTip="图表夹" />
                </Button>
                <telerikNavigation:RadToolBarSeparator />
                <telerik:RadToggleButton>
                    <Image Width="16" Height="16" Source="Images/Res/市场.png" ToolTipService.ToolTip="市场报价" />
                </telerik:RadToggleButton>
                <telerik:RadToggleButton>
                    <Image Width="16" Height="16" Source="Images/Res/dataw.png" ToolTipService.ToolTip="数据窗口" />
                </telerik:RadToggleButton>
                <telerik:RadToggleButton>
                    <Image Width="16" Height="16" Source="Images/Res/daohang.png" ToolTipService.ToolTip="市场报价" />
                </telerik:RadToggleButton>
                <telerik:RadToggleButton>
                    <Image Width="16" Height="16" Source="Images/Res/终端.png" ToolTipService.ToolTip="终端" />
                </telerik:RadToggleButton>
                <telerik:RadToggleButton>
                    <Image Width="16" Height="16" Source="Images/Res/jiaoyi.png" ToolTipService.ToolTip="图表夹" />
                </telerik:RadToggleButton>
                <telerikNavigation:RadToolBarSeparator />
                <Button Tag="新订单">
                    <StackPanel Orientation="Horizontal">
                        <Image Width="16" Height="16" Source="Images/Res/neworder.png" ToolTipService.ToolTip="图表夹" />
                        <TextBlock Text="新订单"  Margin="5,0"/>
                    </StackPanel>
                </Button>
            </telerikNavigation:RadToolBar>
        </StackPanel>
        
        <StackPanel Grid.Row="2" Style="{StaticResource ToolBarStackPanel}">
            <telerikNavigation:RadToolBar  x:Name="mainToolBar3">
                <telerik:RadToggleButton>
                    <Image Width="16" Height="16" Source="Images/Res/border_inside.png" ToolTipService.ToolTip="" />
                </telerik:RadToggleButton>
                <telerik:RadToggleButton>
                    <Image Width="16" Height="16" Source="Images/Res/border_up.png" ToolTipService.ToolTip="" />
                </telerik:RadToggleButton>
                <telerik:RadToggleButton>
                    <Image Width="16" Height="16" Source="Images/Res/border_vertical.png" ToolTipService.ToolTip="" />
                </telerik:RadToggleButton>
                <telerik:RadToggleButton>
                    <Image Width="16" Height="16" Source="Images/Res/fontsizeup.png" ToolTipService.ToolTip="" />
                </telerik:RadToggleButton>
            </telerikNavigation:RadToolBar>

            <telerikNavigation:RadToolBar  x:Name="mainToolBar4">
                <Button Tag="放大" x:Name="btnZoomBig" Click="btnZoomBig_Click">
                    <Image Width="16" Height="16" Source="Images/Res/fdj1.png" ToolTipService.ToolTip="放大" />
                </Button>
                <Button Tag="缩小" x:Name="btnZoomSmall" Click="btnZoomSmall_Click">
                    <Image Width="16" Height="16" Source="Images/Res/fdj2.png" ToolTipService.ToolTip="缩小" />
                </Button>
                <telerikNavigation:RadToolBarSeparator />
            </telerikNavigation:RadToolBar>
            <telerikNavigation:RadToolBar  x:Name="mainToolBar5">
                <telerik:RadToggleButton x:Name="btnM1" Content="M1" Tag="1M" Click="btnToggelTime_Click" />
                <telerik:RadToggleButton x:Name="btnM5" Content="M5" Tag="5M" Click="btnToggelTime_Click" />
                <telerik:RadToggleButton x:Name="btnM15" Content="M15" Tag="15M" Click="btnToggelTime_Click" />
                <telerik:RadToggleButton x:Name="btnM30" Content="M30" Tag="30M" Click="btnToggelTime_Click" />
                <telerik:RadToggleButton x:Name="btnH1" Content="H1" Tag="1H" Click="btnToggelTime_Click" />
                <telerik:RadToggleButton x:Name="btnH4" Content="H4" Tag="4H" Click="btnToggelTime_Click" />
                <telerik:RadToggleButton x:Name="btnD1" Content="D1" Tag="1D" Click="btnToggelTime_Click" />
                <telerik:RadToggleButton x:Name="btnW1" Content="W1" Tag="1W" Click="btnToggelTime_Click" />
                <telerik:RadToggleButton x:Name="btnMN" Content="MN" Tag="1MN" Click="btnToggelTime_Click" />
            </telerikNavigation:RadToolBar>
        </StackPanel>

        <radDock:RadDocking x:Name="radDocking1" Grid.Row="3" Close="radDocking1_Close" >
            
            <radDock:RadDocking.DocumentHost>
                <radDock:RadSplitContainer>
                    <radDock:RadPaneGroup x:Name="RPG1">
                        <!--<radDock:RadPane Header="Dragable1" GotFocus="RadPane_GotFocus">
                            <radDock:RadPane.Content>
                                <ucChart:FXProductChart x:Name="fxpChart1" />
                            </radDock:RadPane.Content>
                        </radDock:RadPane>-->

                        
                    </radDock:RadPaneGroup>
                </radDock:RadSplitContainer>
            </radDock:RadDocking.DocumentHost>

            <radDock:RadSplitContainer x:Name="BottomContainer" radDock:DockingPanel.InitialSize="200,80" InitialPosition="DockedBottom">
                <radDock:RadPaneGroup x:Name="Group3">
                    <radDock:RadPane x:Name="Pane5" Header="Output" Style="{StaticResource FixedRadPane}">
                        <TextBlock TextWrapping="Wrap" Text="Test3 " />
                    </radDock:RadPane>
                    <radDock:RadPane x:Name="Pane6" Header="Error List" Style="{StaticResource FixedRadPane}">
                        <TextBlock TextWrapping="Wrap" Text="Test4 " />
                    </radDock:RadPane>
                </radDock:RadPaneGroup>
            </radDock:RadSplitContainer>
            
            <radDock:RadSplitContainer radDock:DockingPanel.InitialSize="300,400" MaxWidth="600"
                    Name="LeftContainer" InitialPosition="DockedLeft" Orientation="Vertical">
                <radDock:RadPaneGroup x:Name="Group1">
                    <radDock:RadPane x:Name="Pane1" Header="市场报价" Style="{StaticResource FixedRadPane}">
                        <uc:InstantMarketQuoteGrid x:Name="instantMarketQuoteGrid" />
                    </radDock:RadPane>
                    <radDock:RadPane x:Name="Pane2" Header="即时图" Style="{StaticResource FixedRadPane}">
                        <TextBlock TextWrapping="Wrap" Text="即时图 " />
                    </radDock:RadPane>
                </radDock:RadPaneGroup>
            </radDock:RadSplitContainer>

            <radDock:RadSplitContainer radDock:DockingPanel.InitialSize="200,400" MaxWidth="600"
                    Name="RightContainer" InitialPosition="DockedRight" Orientation="Vertical">
                <radDock:RadPaneGroup x:Name="rpgDataWindow">
                    <radDock:RadPane x:Name="rpDataWindow" Header="数据窗口" Style="{StaticResource FixedRadPane}">
                        <uc:InstantDataWindow x:Name="idw" />
                    </radDock:RadPane>
                </radDock:RadPaneGroup>
            </radDock:RadSplitContainer>
        </radDock:RadDocking>
        
        
        <!--Login Control-->
        <uc:UserLogin x:Name="ucUserLogin" HorizontalAlignment="Right" Visibility="Collapsed" />
        
        <Grid x:Name="gdWindows" Grid.RowSpan="4">
            <ucWindow:AddingUserWindow x:Name="ucwAdduser"/>
            <ucWindow:LoginWindow x:Name="ucwLogin"/>

            <toolkit:BusyIndicator DisplayAfter="0" BusyContent="正在加载......"  Name="busyIndicator" IsBusy="{Binding Path=IsLoading,Source={StaticResource FXSystemContext}}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" />
        </Grid>
    </Grid>
</UserControl>
